home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cppsvx.z / cppsvx
Encoding:
Text File  |  2002-10-03  |  11.9 KB  |  331 lines

  1.  
  2.  
  3.  
  4. CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CPPSVX - use the Cholesky factorization A = U**H*U or A = L*L**H to
  10.      compute the solution to a complex system of linear equations A * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE CPPSVX( FACT, UPLO, N, NRHS, AP, AFP, EQUED, S, B, LDB, X,
  14.                         LDX, RCOND, FERR, BERR, WORK, RWORK, INFO )
  15.  
  16.          CHARACTER      EQUED, FACT, UPLO
  17.  
  18.          INTEGER        INFO, LDB, LDX, N, NRHS
  19.  
  20.          REAL           RCOND
  21.  
  22.          REAL           BERR( * ), FERR( * ), RWORK( * ), S( * )
  23.  
  24.          COMPLEX        AFP( * ), AP( * ), B( LDB, * ), WORK( * ), X( LDX, * )
  25.  
  26. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  27.      These routines are part of the SCSL Scientific Library and can be loaded
  28.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  29.      directs the linker to use the multi-processor version of the library.
  30.  
  31.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  32.      4 bytes (32 bits). Another version of SCSL is available in which integers
  33.      are 8 bytes (64 bits).  This version allows the user access to larger
  34.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  35.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  36.      only one of the two versions; 4-byte integer and 8-byte integer library
  37.      calls cannot be mixed.
  38.  
  39. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  40.      CPPSVX uses the Cholesky factorization A = U**H*U or A = L*L**H to
  41.      compute the solution to a complex system of linear equations A * X = B,
  42.      where A is an N-by-N Hermitian positive definite matrix stored in packed
  43.      format and X and B are N-by-NRHS matrices.
  44.  
  45.      Error bounds on the solution and a condition estimate are also provided.
  46.  
  47.  
  48. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.      The following steps are performed:
  50.  
  51.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  52.         the system:
  53.            diag(S) * A * diag(S) * inv(diag(S)) * X = diag(S) * B
  54.         Whether or not the system will be equilibrated depends on the
  55.         scaling of the matrix A, but if equilibration is used, A is
  56.         overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
  57.  
  58.      2. If FACT = 'N' or 'E', the Cholesky decomposition is used to
  59.         factor the matrix A (after equilibration if FACT = 'E') as
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  71.  
  72.  
  73.  
  74.            A = U'* U ,  if UPLO = 'U', or
  75.            A = L * L',  if UPLO = 'L',
  76.         where U is an upper triangular matrix, L is a lower triangular
  77.         matrix, and ' indicates conjugate transpose.
  78.  
  79.      3. If the leading i-by-i principal minor is not positive definite,
  80.         then the routine returns with INFO = i. Otherwise, the factored
  81.         form of A is used to estimate the condition number of the matrix
  82.         A.  If the reciprocal of the condition number is less than machine
  83.         precision, INFO = N+1 is returned as a warning, but the routine
  84.         still goes on to solve for X and compute error bounds as
  85.         described below.
  86.  
  87.      4. The system of equations is solved for X using the factored form
  88.         of A.
  89.  
  90.      5. Iterative refinement is applied to improve the computed solution
  91.         matrix and calculate error bounds and backward error estimates
  92.         for it.
  93.  
  94.      6. If equilibration was used, the matrix X is premultiplied by
  95.         diag(S) so that it solves the original system before
  96.         equilibration.
  97.  
  98.  
  99. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  100.      FACT    (input) CHARACTER*1
  101.              Specifies whether or not the factored form of the matrix A is
  102.              supplied on entry, and if not, whether the matrix A should be
  103.              equilibrated before it is factored.  = 'F':  On entry, AFP
  104.              contains the factored form of A.  If EQUED = 'Y', the matrix A
  105.              has been equilibrated with scaling factors given by S.  AP and
  106.              AFP will not be modified.  = 'N':  The matrix A will be copied to
  107.              AFP and factored.
  108.              = 'E':  The matrix A will be equilibrated if necessary, then
  109.              copied to AFP and factored.
  110.  
  111.      UPLO    (input) CHARACTER*1
  112.              = 'U':  Upper triangle of A is stored;
  113.              = 'L':  Lower triangle of A is stored.
  114.  
  115.      N       (input) INTEGER
  116.              The number of linear equations, i.e., the order of the matrix A.
  117.              N >= 0.
  118.  
  119.      NRHS    (input) INTEGER
  120.              The number of right hand sides, i.e., the number of columns of
  121.              the matrices B and X.  NRHS >= 0.
  122.  
  123.      AP      (input/output) COMPLEX array, dimension (N*(N+1)/2)
  124.              On entry, the upper or lower triangle of the Hermitian matrix A,
  125.              packed columnwise in a linear array, except if FACT = 'F' and
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  137.  
  138.  
  139.  
  140.              EQUED = 'Y', then A must contain the equilibrated matrix
  141.              diag(S)*A*diag(S).  The j-th column of A is stored in the array
  142.              AP as follows:  if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for
  143.              1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for
  144.              j<=i<=n.  See below for further details.  A is not modified if
  145.              FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.
  146.  
  147.              On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by
  148.              diag(S)*A*diag(S).
  149.  
  150.      AFP     (input or output) COMPLEX array, dimension (N*(N+1)/2)
  151.              If FACT = 'F', then AFP is an input argument and on entry
  152.              contains the triangular factor U or L from the Cholesky
  153.              factorization A = U**H*U or A = L*L**H, in the same storage
  154.              format as A.  If EQUED .ne. 'N', then AFP is the factored form of
  155.              the equilibrated matrix A.
  156.  
  157.              If FACT = 'N', then AFP is an output argument and on exit returns
  158.              the triangular factor U or L from the Cholesky factorization A =
  159.              U**H*U or A = L*L**H of the original matrix A.
  160.  
  161.              If FACT = 'E', then AFP is an output argument and on exit returns
  162.              the triangular factor U or L from the Cholesky factorization A =
  163.              U**H*U or A = L*L**H of the equilibrated matrix A (see the
  164.              description of AP for the form of the equilibrated matrix).
  165.  
  166.      EQUED   (input or output) CHARACTER*1
  167.              Specifies the form of equilibration that was done.  = 'N':  No
  168.              equilibration (always true if FACT = 'N').
  169.              = 'Y':  Equilibration was done, i.e., A has been replaced by
  170.              diag(S) * A * diag(S).  EQUED is an input argument if FACT = 'F';
  171.              otherwise, it is an output argument.
  172.  
  173.      S       (input or output) REAL array, dimension (N)
  174.              The scale factors for A; not accessed if EQUED = 'N'.  S is an
  175.              input argument if FACT = 'F'; otherwise, S is an output argument.
  176.              If FACT = 'F' and EQUED = 'Y', each element of S must be
  177.              positive.
  178.  
  179.      B       (input/output) COMPLEX array, dimension (LDB,NRHS)
  180.              On entry, the N-by-NRHS right hand side matrix B.  On exit, if
  181.              EQUED = 'N', B is not modified; if EQUED = 'Y', B is overwritten
  182.              by diag(S) * B.
  183.  
  184.      LDB     (input) INTEGER
  185.              The leading dimension of the array B.  LDB >= max(1,N).
  186.  
  187.      X       (output) COMPLEX array, dimension (LDX,NRHS)
  188.              If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the
  189.              original system of equations.  Note that if EQUED = 'Y', A and B
  190.              are modified on exit, and the solution to the equilibrated system
  191.              is inv(diag(S))*X.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      LDX     (input) INTEGER
  207.              The leading dimension of the array X.  LDX >= max(1,N).
  208.  
  209.      RCOND   (output) REAL
  210.              The estimate of the reciprocal condition number of the matrix A
  211.              after equilibration (if done).  If RCOND is less than the machine
  212.              precision (in particular, if RCOND = 0), the matrix is singular
  213.              to working precision.  This condition is indicated by a return
  214.              code of INFO > 0.
  215.  
  216.      FERR    (output) REAL array, dimension (NRHS)
  217.              The estimated forward error bound for each solution vector X(j)
  218.              (the j-th column of the solution matrix X).  If XTRUE is the true
  219.              solution corresponding to X(j), FERR(j) is an estimated upper
  220.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  221.              divided by the magnitude of the largest element in X(j).  The
  222.              estimate is as reliable as the estimate for RCOND, and is almost
  223.              always a slight overestimate of the true error.
  224.  
  225.      BERR    (output) REAL array, dimension (NRHS)
  226.              The componentwise relative backward error of each solution vector
  227.              X(j) (i.e., the smallest relative change in any element of A or B
  228.              that makes X(j) an exact solution).
  229.  
  230.      WORK    (workspace) COMPLEX array, dimension (2*N)
  231.  
  232.      RWORK   (workspace) REAL array, dimension (N)
  233.  
  234.      INFO    (output) INTEGER
  235.              = 0:  successful exit
  236.              < 0:  if INFO = -i, the i-th argument had an illegal value
  237.              > 0:  if INFO = i, and i is
  238.              <= N:  the leading minor of order i of A is not positive
  239.              definite, so the factorization could not be completed, and the
  240.              solution has not been computed. RCOND = 0 is returned.  = N+1: U
  241.              is nonsingular, but RCOND is less than machine precision, meaning
  242.              that the matrix is singular to working precision.  Nevertheless,
  243.              the solution and error bounds are computed because there are a
  244.              number of situations where the computed solution can be more
  245.              accurate than the value of RCOND would suggest.
  246.  
  247. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  248.      The packed storage scheme is illustrated by the following example when N
  249.      = 4, UPLO = 'U':
  250.  
  251.      Two-dimensional storage of the Hermitian matrix A:
  252.  
  253.         a11 a12 a13 a14
  254.             a22 a23 a24
  255.                 a33 a34     (aij = conjg(aji))
  256.                     a44
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))                                                          CCCCPPPPPPPPSSSSVVVVXXXX((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      Packed storage of the upper triangle of A:
  273.  
  274.      AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
  275.  
  276.  
  277. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  278.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  279.  
  280.      This man page is available only online.
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.